# Monarc makefile

CC  = gcc
AS  = nasm
LD  = ld
AR  = ar
SED = sed
PL = perl

INCL = \
	-Iinclude \
	-I../libc/include \
	-I../libsys/include \
	-I../libsupc++/include \
	-I../agg/include \

DEFINES = \
	-D__DEBUG=1 \

C_OPT = -Wall -O -ffreestanding -nostartfiles -nodefaultlibs -nostdlib -nostdinc $(INCL) $(DEFINES)
OC_OPT = -Wall -O -ffreestanding -nostartfiles -nodefaultlibs -nostdlib -nostdinc $(INCL) $(DEFINES)

CC_OPT = -Wall -O -nostartfiles -fno-builtin -nodefaultlibs -nostdlib -nostdinc $(INCL) $(DEFINES)
OCC_OPT = -Wall -O -nostartfiles -fno-builtin -nodefaultlibs -nostdlib -nostdinc $(INCL) $(DEFINES)

MKDIR = mkdir
CP = cp
CAT = cat
RM = rm -f

c_sources = \

sources = \
	Component.cc \
	Container.cc \
	FlowLayout.cc \
	GridLayout.cc \
	Frame.cc \
	Button.cc \
	Image.cc \
	GUIResource.cc \
	tga.cc \
	fonts.cc \
	#Rectangle.cc \
	

asm_sources = \
	
	

all: libgui.a

clean:
	$(RM) *.o libgui.a

libgui.a: $(sources:.cc=.o) $(c_sources:.c=.o) $(asm_sources:.asm=.o)
	ar cru $@ $?

%.o : %.asm
	$(REDIR) $(AS) -fwin32 $< -o $@

%.o: %.c
	$(REDIR) $(CC) $(OC_OPT) -c $< -o $@

%.o: %.cc
	$(REDIR) $(CC) $(OCC_OPT) -c $< -o $@

